{extend name="public/base"/}
{block name="css"}
<link href="{$Think.HOME_STATIC}css/notebook.css" rel="stylesheet">
<!--<link href="{$Think.HOME_STATIC}css/editormd.css" rel="stylesheet">
<link href="{$Think.EDITOR_PATH}lib/codemirror/codemirror.min.css" rel="stylesheet">-->
<link href="{$Think.HOME_STATIC}css/font-awesome.min.css" rel="stylesheet">
{/block}

{block name="center_left"}
<div id="navsecond" class="float-left">
    <div class="catalog" data-coverid='{$coverid}' data-shelfid="{$shelfid}">
        <div class="title" data-value="{$covername}">
            笔记本：{$covername}学习笔记
            {eq name="$parentid" value="0"}
            <b class='fa fa-hand-o-left fa-inverse' title='编辑中...'></b>
            {/eq}
        </div>
    </div>
    <div class="innerUl">
        <ul class='menuUl' id="rootMenu">
            {volist name="catelog_info" id="item"}
            <li data-id='{$item.id}' data-parentid="0">
                <i class='fa fa-folder fa-inverse isfolder'></i>
                <span>{$item.catalog_name}</span>
            </li>
            {/volist}
        </ul>
    </div>
</div>
{/block}

{block name="center_main"}
<div id="maincontent" class="float-right">
    <ul id="articleNav">
        <li data-id="0"><span>{$covername}学习笔记</span></li>
    </ul>
    <ul id="articleList" data-parentid="0">
        {volist name="catelog_info" id="item"}
        <li data-id='{$item.id}' data-type='folder'>
            <i class='fa fa-folder fa-inverse isfolder'></i>
            <span><a href="javascript:;">{$item.catalog_name}</a></span>
        </li>
        {/volist}
        {volist name="article_info" id="item"}
        <li data-id='{$item.id}' data-type="file">
            <i draggable='true' ischek='false' class='fa fa-file fa-inverse isfile'></i>
            <span><a href="javascript:;">{$item.article_title}</a></span>
        </li>
        {/volist}
    </ul>
</div>
{/block}

{block name="footer_js"}
<script src="{$Think.STATIC_PATH}js/require.min.js"></script>
<script type="text/javascript">
    require.config({
        baseUrl: "{$Think.EDITOR_PATH}",
        paths: {
            jquery: "../js/jquery.min",
            chapter: "../home/js/notebook.chapter",
            hDialog: "../home/js/jquery.hDialog"
        },
        shim: {
            'hDialog': {
                deps: ['jquery']
            },
            'chapter': {
                deps: ['hDialog']
            }
        },
        waitSeconds: 30
    });
    var deps = [
        "hDialog",
        "chapter"
    ];

    require(deps, function (editormd) {
        $("body").Chapter({
            simIcon: "fa fa-file fa-inverse isfile",
            mouIconOpen: "fa fa-folder-open-o fa-inverse isfolder",
            mouIconClose: "fa fa-folder fa-inverse isfolder",
            mouIconEmpty: "fa fa-folder-o isfolder",
            getListUrl: "{:url('home/notebook/index')}",
            getArticleUrl: "{:url('home/notebook/getArticle')}",
            editormd: editormd,
            callbackEdit: function (id) {
                alert(id);
            }

        });
    });
</script>

{/block}